package zxzx.controller.AcctBsSgmtController;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import zxzx.controller.AcctBsSgmtService.OrigCreditorInfSgmtService;
import zxzx.controller.pojo.OrigCreditorInfSgmt;
import zxzx.controller.pojo.Result;

@RestController
@RequestMapping("origCreditorInfSgmt")
public class OrigCreditorInfSgmtController {

	@Autowired
	private OrigCreditorInfSgmtService origCreditorInfSgmtService;
	
	@RequestMapping("save")
	public Result  save(@RequestBody OrigCreditorInfSgmt origCreditorInfSgmt) {
		origCreditorInfSgmtService.save(origCreditorInfSgmt);
		return new Result(true, "保存成功");
	}
	@RequestMapping("/findAll")
	public List<OrigCreditorInfSgmt> findAll(){
		return origCreditorInfSgmtService.findAll();
	}
	@RequestMapping("/findOne/{id}")
	public Optional<OrigCreditorInfSgmt> findOne(@PathVariable Integer id){
		return origCreditorInfSgmtService.findById(id);
	}
	@RequestMapping("/update")
	public Result update(@RequestBody OrigCreditorInfSgmt origCreditorInfSgmt){
		origCreditorInfSgmtService.update(origCreditorInfSgmt);
		return new Result(true, "修改成功");
	}
	@RequestMapping("/createXml/{id}")
	public Result createXml(@PathVariable Integer id){
		origCreditorInfSgmtService.createXml(id);
		return new Result(true, "生成成功");
	}
	
	
	
	
	
}
